package model;

import java.util.ArrayList;
import java.util.List;
import javafx.beans.property.SimpleStringProperty;

/**
 *
 * @author Merli András-Bertalan
 */
public class Database {

    private final SimpleStringProperty name;
    private final List<Table> tables;
    private final List<Table> indexTables;

    public Database(String name) {
        this.name = new SimpleStringProperty(name);
        tables = new ArrayList<>();
        indexTables = new ArrayList<>();
    }

    public String getName() {
        return name.get();
    }

    public void setName(String name) {
        this.name.set(name);
    }

    public void addTable(Table table) {
        tables.add(table);
    }

    public void deleteTable(Table table) {
        tables.remove(table);
    }
    
    public void addIndexTable(Table table) {
        indexTables.add(table);
    }
    
    public void deleteIndexTable(Table table) {
        indexTables.remove(table);
    }

    public List<Table> getTables() {
        return tables;
    }

    public List<Table> getIndexTables() {
        return indexTables;
    }
}
